[Contents]
[Index]
[Help]
[Browse <]
[Browse >]
dopus getstring <text> [secure] [<length>] [<default>] [<buttons>]
This command allows you to prompt the user to input a text string.
text is a string of text to be displayed in the requester, and should be
surrounded by quotes if it contains spaces.
The secure keyword causes the string to be displayed as asterisks ("*"),
which can be useful for passwords.
length is the maximum length of string to accept and defaults to 80 if
not specified.
default is the default value of the string; that is, the text you wish to
initially appear in the field.
buttons are the buttons you wish the requester to have; each button
should be separated by a vertical bar character ("|"). If the buttons
parameter is omitted the requester will have a single button marked "OK".
For example,
> dopus getstring '"Please enter some text" 40 "" Okay|Cancel'
Note the quotes around the entire argument string.
You can have multiple lines in the requester text by putting the "return"
character at the end of lines.
This would display a requester with the string "Please enter some text", a
maximum input length of 40 characters, an empty default sting, and buttons
labelled "Okay" and "Cancel".
The string (if any) is returned in RESULT . The cardinal number of the
selected button is returned in the special variable DOPUSRC , but the
last (rightmost) gadget is always number 0. In the above example, if the
user clicked "Okay", DOPUSRC would contain 1, and if the user clicked
"Cancel" it would contain 0. If the RETURN key is used in the string gadget
to accept the text, then the DOPUSRC variable will contain the value -1.
This command and the lister getstring command are the only ones that use
the DOPUSRC variable currently, but this may change in the future.
Please note that previous versions of Opus 5 did not clear RESULT if an
empty string was entered. Make sure that this change does not affect your
scripts. Also note that the DOPUSRC variable did not exist in the
original version of Opus 5.
See also:
dopus request
lister getstring
lister request
Converted on 04 Nov 1998 with RexxDoesAmigaGuide2HTML 2.2 by Michael Ranner.